-
Couldn't load subscription status.
- Fork 1.5k
Fix #14206 --showtime does not account for addons #7904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
LGTM. As an improvement the time could also be collected for the individual addons. |
|
as a start LGTM.. I have some small nits.. like "cancell" should be "cancel". I would like that we reuse this timer for the "--showtime=file-total" output also so a different class name would be better. |
| #include <algorithm> | ||
| #include <array> | ||
| #include <cassert> | ||
| #include <chrono> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we include it in the timer now
|
|
|
||
| int CppCheckExecutor::check(int argc, const char* const argv[]) | ||
| { | ||
| Timer realTimeClock("", SHOWTIME_MODES::SHOWTIME_SUMMARY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you made it a RAII. If the timer is moved down below the CmdLineParser then we don't need to cancel the timer. That could maybe loose a millisecond.. but this is acceptable imho. I don't care if the total time says 1.978s or 1.979s ..
| if (Settings::terminated()) | ||
| return mLogger->exitcode(); | ||
|
|
||
| const Timer fileTotalTimer(mSettings.showtime == SHOWTIME_MODES::SHOWTIME_FILE_TOTAL, file.spath()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the old interface so we don't have to cancel it..
| , mStart(std::clock()) | ||
| , mShowTimeMode(showtimeMode) | ||
| , mStopped(showtimeMode == SHOWTIME_MODES::SHOWTIME_NONE || showtimeMode == SHOWTIME_MODES::SHOWTIME_FILE_TOTAL) | ||
| , mStartTimePoint(Clock::now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why we need to have both mStart and mStartTimePoint. Why not remove the std::clock() handling and always use Clock::now() instead?



No description provided.